function [] = main(filename)
%MAIN Summary of this function goes here
%   Detailed explanation goes here


screens=Screen('Screens');
screenNumber=max(screens);
[w,rect]=Screen('OpenWindow', screenNumber);
      
exp_con_lectura_palabras(w, screenNumber,'lll', 'palabra_letra', 0.8 , 'ruido',1);
exp_con_lectura_palabras(w, screenNumber,'lll', 'palabra_letra', 1.4 , 'ruido',1);
exp_con_lectura_palabras(w, screenNumber,'lll', 'digitorandom_digitorandom', 0.2 , 'ruido',1);
exp_con_lectura_palabras(w, screenNumber,'lll', 'secuencia_digitorandom', 0.8 , 'ruido',1);

   %Seteo las variables para escribir texto
    [width, height]=Screen('WindowSize', screenNumber);
        white = WhiteIndex(w);  
     Screen('FillRect', w, white);
     Screen('TextFont', w, 'Courier New');
     Screen('TextSize', w, 60);
     Screen('TextStyle', w, 1+2);
     Screen('DrawText', w, 'Empieza el experimento. presione cualquier tecla', width/2, height/2, [0, 0, 0, 255]);
%     
     Screen('Flip', w);
    KbWait
i=0;

while i < 2
    
        exp_con_lectura_palabras(w, screenNumber, filename, 'digitorandom_digitorandom', 0.8 , 'ruido',4);
   exp_con_lectura_palabras(w, screenNumber, filename,'secuencia_digitorandom', 1.4 , 'ruido',3);

    exp_con_lectura_palabras(w, screenNumber, filename, 'palabra_letra', 1.4 , 'ruido',1);


    exp_con_lectura_palabras(w, screenNumber, filename, 'letra_letra', 0.2 , 'ruido',2);
    exp_con_lectura_palabras(w, screenNumber, filename, 'letra_letra', 0.8 , 'ruido',2);
        exp_con_lectura_palabras(w, screenNumber, filename, 'digitorandom_digitorandom', 0.2 , 'ruido',4);
    exp_con_lectura_palabras(w, screenNumber, filename,'secuencia_digitorandom', 0.2 , 'ruido',3);

    exp_con_lectura_palabras(w, screenNumber, filename, 'letra_letra', 1.4 , 'ruido',2);
    exp_con_lectura_palabras(w, screenNumber, filename, 'palabra_letra', 0.8 , 'ruido',1);

    exp_con_lectura_palabras(w, screenNumber, filename,'secuencia_digitorandom', 0.8 , 'ruido',3);
        exp_con_lectura_palabras(w, screenNumber, filename, 'palabra_letra', 0.2 , 'ruido',1);
    exp_con_lectura_palabras(w, screenNumber, filename, 'digitorandom_digitorandom', 1.4 , 'ruido',4);
    
    
    %%%%%%%%%%%%% segunda
    
          
    exp_con_lectura_palabras(w, screenNumber, filename, 'digitorandom_digitorandom', 0.8 , 'ruido',4);
            exp_con_lectura_palabras(w, screenNumber, filename, 'digitorandom_digitorandom', 0.2 , 'ruido',4);
    exp_con_lectura_palabras(w, screenNumber, filename, 'letra_letra', 0.8 , 'ruido',2);

    exp_con_lectura_palabras(w, screenNumber, filename,'secuencia_digitorandom', 1.4 , 'ruido',3);

    exp_con_lectura_palabras(w, screenNumber, filename, 'palabra_letra', 1.4 , 'ruido',1);
        exp_con_lectura_palabras(w, screenNumber, filename, 'letra_letra', 1.4 , 'ruido',2);
            exp_con_lectura_palabras(w, screenNumber, filename, 'digitorandom_digitorandom', 1.4 , 'ruido',4);


        exp_con_lectura_palabras(w, screenNumber, filename, 'palabra_letra', 0.2 , 'ruido',1);


    exp_con_lectura_palabras(w, screenNumber, filename, 'letra_letra', 0.2 , 'ruido',2);

           exp_con_lectura_palabras(w, screenNumber, filename,'secuencia_digitorandom', 0.8 , 'ruido',3);
               exp_con_lectura_palabras(w, screenNumber, filename,'secuencia_digitorandom', 0.2 , 'ruido',3);

    exp_con_lectura_palabras(w, screenNumber, filename, 'palabra_letra', 0.8 , 'ruido',1);


     %%%%%%%%%%%%% tercera

    
            exp_con_lectura_palabras(w, screenNumber, filename, 'digitorandom_digitorandom', 0.2 , 'ruido',4);

    exp_con_lectura_palabras(w, screenNumber, filename, 'letra_letra', 0.8 , 'ruido',2);


    exp_con_lectura_palabras(w, screenNumber, filename, 'palabra_letra', 1.4 , 'ruido',1);
        exp_con_lectura_palabras(w, screenNumber, filename, 'letra_letra', 1.4 , 'ruido',2);
            exp_con_lectura_palabras(w, screenNumber, filename, 'palabra_letra', 0.8 , 'ruido',1);

            exp_con_lectura_palabras(w, screenNumber, filename, 'digitorandom_digitorandom', 1.4 , 'ruido',4);


    exp_con_lectura_palabras(w, screenNumber, filename,'secuencia_digitorandom', 1.4 , 'ruido',3);

                           exp_con_lectura_palabras(w, screenNumber, filename, 'digitorandom_digitorandom', 0.8 , 'ruido',4);


    exp_con_lectura_palabras(w, screenNumber, filename, 'letra_letra', 0.2 , 'ruido',2);

           exp_con_lectura_palabras(w, screenNumber, filename,'secuencia_digitorandom', 0.8 , 'ruido',3);

                   exp_con_lectura_palabras(w, screenNumber, filename, 'palabra_letra', 0.2 , 'ruido',1);

                           exp_con_lectura_palabras(w, screenNumber, filename,'secuencia_digitorandom', 0.2 , 'ruido',3);

    
                           %%%%%%% Cuarta
                           

                           exp_con_lectura_palabras(w, screenNumber, filename,'secuencia_digitorandom', 0.2 , 'ruido',3);

                                 exp_con_lectura_palabras(w, screenNumber, filename, 'digitorandom_digitorandom', 0.2 , 'ruido',4);

    exp_con_lectura_palabras(w, screenNumber, filename, 'palabra_letra', 1.4 , 'ruido',1);
            exp_con_lectura_palabras(w, screenNumber, filename, 'palabra_letra', 0.8 , 'ruido',1);
    exp_con_lectura_palabras(w, screenNumber, filename, 'letra_letra', 0.8 , 'ruido',2);

            exp_con_lectura_palabras(w, screenNumber, filename, 'digitorandom_digitorandom', 1.4 , 'ruido',4);

        exp_con_lectura_palabras(w, screenNumber, filename, 'letra_letra', 1.4 , 'ruido',2);

                   exp_con_lectura_palabras(w, screenNumber, filename, 'palabra_letra', 0.2 , 'ruido',1);



    exp_con_lectura_palabras(w, screenNumber, filename, 'letra_letra', 0.2 , 'ruido',2);
    exp_con_lectura_palabras(w, screenNumber, filename,'secuencia_digitorandom', 1.4 , 'ruido',3);

           exp_con_lectura_palabras(w, screenNumber, filename,'secuencia_digitorandom', 0.8 , 'ruido',3);
                           exp_con_lectura_palabras(w, screenNumber, filename, 'digitorandom_digitorandom', 0.8 , 'ruido',4);


                           
    i = i +1;
end

   
                           
 %mirespuesta(w,screenNumber);
% 
% 
Screen('CloseAll');


end